const ctxPath = document.getElementById("ctxPath").value;
//底部日期
document.getElementById('datetime').innerHTML=new Date().getFullYear();
let initVar = {
    "homeInfo": {
        "title": "首页",
        "href": ""
    },
    "logoInfo": {
        "title": "干扰监测分析系统",
        "image": "img/skin/logo_trains.jpeg",
        "href": ""
    },
    "menuInfo": [
        {
            "title": "404页面",
            "icon": "fa fa-slideshare",
            "href": "/gydz/404",
            "target": "_self",
            "child": []
        },
        {
            "title": "用户列表",
            "icon": "fa fa-slideshare",
            "href": ctxPath+"/userCenter/list",
            "target": "_self",
            "child": []
        },
        {
            "title": "干扰告警",
            "icon": "fa fa-slideshare",
            "href": "",
            "target": "_self",
            "child": [
                {
                    "title": "GSM-R干扰告警",
                    "href": "",
                    "icon": "fa fa-superpowers",
                    "target": "_self",
                    "child":[
                        {
                            "title": "事实干扰",
                            "icon": "fa fa-slideshare",
                            "href": ctxPath+"/dmsNew/list",
                            "target": "_self"
                        },
                        {
                            "title": "潜在干扰",
                            "icon": "fa fa-slideshare",
                            "href": ctxPath+"/dmsNew/list",
                            "target": "_self"
                        },
                        {
                            "title": "历史干扰",
                            "icon": "fa fa-slideshare",
                            "href": ctxPath+"/dmsNew/list",
                            "target": "_self"
                        }
                    ]
                },
                {
                    "title": "450M干扰告警",
                    "href": "",
                    "icon": "fa fa-superpowers",
                    "target": "_self",
                    "child":[
                        {
                            "title": "事实干扰",
                            "icon": "fa fa-slideshare",
                            "href": ctxPath+"/dmsNew/list",
                            "target": "_self"
                        },
                        {
                            "title": "潜在干扰",
                            "icon": "fa fa-slideshare",
                            "href": ctxPath+"/dmsNew/list",
                            "target": "_self"
                        },
                        {
                            "title": "历史干扰",
                            "icon": "fa fa-slideshare",
                            "href": ctxPath+"/dmsNew/list",
                            "target": "_self"
                        }
                    ]
                },
            ]
        }
    ]
}
layui.use(['jquery', 'layer', 'miniAdmin','miniTongji'], function () {
    var $ = layui.jquery,
        layer = layui.layer,
        miniAdmin = layui.miniAdmin,
        miniTongji = layui.miniTongji;

    var options = {
        iniUrl: null,    // 初始化接口
        clearUrl: "<%=basePath%>/static/layuimini/api/clear.json", // 缓存清理接口
        urlHashLocation: true,      // 是否打开hash定位
        bgColorDefault: false,      // 主题默认配置
        multiModule: false,          // 是否开启多模块
        menuChildOpen: false,       // 是否默认展开菜单
        loadingTime: 0,             // 初始化加载时间
        pageAnim: true,             // iframe窗口动画
        maxTabNum: 20,              // 最大的tab打开数量
        menuData:initVar            //初始化菜单
    };
    miniAdmin.render(options);

    // 百度统计代码，只统计指定域名
    miniTongji.render({
        specific: true,
        domains: [
        ],
    });

    $('.login-out').on("click", function () {
        layer.msg('退出登录成功', function () {
            parent.location.href = '/user/logout';
        });
    });
    $('.layuimini-menu-left .layui-nav').width(250);
});